import request from "@/utils/request";
import { file } from "@/api/file/index";
export const dangerKeep = {
  add: (data) => {
    return request({
      url: "/dangerKeep/create",
      method: "post",
      data: data,
    });
  },
  query: (params) => {
    return request({
      url: "/dangerKeep/list",
      method: "get",
      params,
    });
  },
  del: (row) => {
    return request({
      url: "/dangerKeep/delete",
      method: "get",
      params: {
        id: row.id,
      },
    }).then((res) => {
      if (row.fileId) {
        file.del(row.fileId);
      }
      return res;
    });
  },
  update: (data) => {
    return request({
      url: "/dangerKeep/update",
      method: "post",
      data: data,
    });
  },
};
